package com.cn.wanxi.dao.impl;

import com.cn.wanxi.dao.CompanyDao;
import com.cn.wanxi.model.CompanyModel;

import java.util.List;

/**
 * 数据实现层
 * 1.封装sql语句
 * 2.调用连接数据库JDBC
 */
public class CompanyImpl implements CompanyDao {
    @Override
    public int add(CompanyModel companyModel) {
        String sql = "INSERT INTO `company` " +
                "(`logo`, `phone`, `ad`, " +
                "`net`, `email`, `line_phone`, " +
                "`version`, `address`, `is_show`," +
                " `enable`, `name`) VALUES " +
                "('" + companyModel.getLogo() + "', '" + companyModel.getPhone() + "', '" + companyModel.getAddress() + "', " +
                "'1', '1', '1'," +
                " '1', '1', '1'," +
                " '1', '1');\n";
//        jdbc 编译sql语句容易sql注入

        return 0;
    }

    @Override
    public int update(CompanyModel companyModel) {
        return 0;
    }

    @Override
    public int delete(CompanyModel companyModel) {
        return 0;
    }

    @Override
    public List<CompanyModel> findAll(CompanyModel companyModel) {
        return null;
    }

    @Override
    public CompanyModel findById(CompanyModel companyModel) {
        return null;
    }

    @Override
    public int getCount(CompanyModel companyModel) {
        return 0;
    }
}
